An electronic device, such as a fan, a light or the like may meet different needs for power by adjusting its gear to different levels of use. The electronic device may further have a timing function, and operate continuously according to an operating period set by a user until the timing period expires. However, some of the electronic devices are only powered by batteries, and energy supplied by the batteries may not be sufficient to enable the device to continuously operate for the operating period set by the user.